package com.rui.study.algorithm.T_响应式编程_RxJava;

import io.reactivex.Observable;

import java.util.Arrays;
import java.util.List;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2019-03-18 17:15
 **/
public class RxJavaTest {

    public static void main(String[] args) {
        Integer[] nums = {1, 3, 4, 6};
        Observable<Integer> numObservable = Observable.fromArray(nums);
        numObservable.subscribe(System.out::println);

        List<String> list = Arrays.asList("red", "green", "blue", "brown", "yellow", "white");
        Observable<String> listObservable = Observable.fromIterable(list);

        listObservable.subscribe(s -> System.out.println(s.toLowerCase()));
        listObservable.subscribe(s -> System.out.println(s.toUpperCase()));
    }
}
